<!-- Page statistics and control buttons area -->
    <div class="statsRow">
        <div class="wrapper statsItems">
        
        	<!-- Stats item -->
            <div class="sItem usersStats">
                <h2><a title="" class="value">500<span>Advertisers</span></a></h2>
                <div class="statsDetailed" id="s3">
                    <div class="statsContent">
                        <div class="sElements">
                            <div class="sDisplay"><h4>350</h4><span>active</span></div>
                            <div class="sDisplay"><h4>50</h4><span>blocked</span></div>
                            <div class="sDisplay"><h4>100</h4><span>pending</span></div>
                        </div>
                        <span class="line"></span>
                        <div class="statsUpdate">
                            <span>Next update in:</span>
                            <span>10 hrs 55 min</span>
                            <div class="contentProgress"><div class="barG tipS" id="bar3" title="32%"></div></div>
                        </div>
                        <div class="statsDropBtn"><a href="#" class="button basic"><img src="/images/icons/dark/users.png" class="icon" alt="" /><span>View advertisers</span></a></div>
                    </div>
                </div>
                <span class="changes">
                    <span class="zeroBar" values="5,10,15,20,25,30,35,40,45,50"></span>
                    <span class="zero">0.0%</span>
                </span>
            </div>
			
				<!-- Stats item -->
            <div class="sItem ticketsStats">
                <h2><a title="" class="value">200<span>Campaigns</span></a></h2>
                <div class="statsDetailed" id="s1">
                    <div class="statsContent">
                        <div class="sElements">
                            <div class="sDisplay"><h4>100</h4><span>active</span></div>
                            <div class="sDisplay"><h4>75</h4><span>stopped</span></div>
                            <div class="sDisplay"><h4>25</h4><span>blocked</span></div>
                        </div>
                        <span class="line"></span>
                        <div class="statsUpdate">
                            <span>Next update in:</span>
                            <span>19 hrs 49 min</span>
                            <div class="contentProgress"><div class="barG tipS" title="19%" id="bar1"></div></div>
                        </div>
                        <div class="statsDropBtn"><a href="#" class="button basic"><img src="/images/icons/dark/stats.png" class="icon" alt="" /><span>View statistics</span></a></div>
                    </div>
                </div>
                <span class="changes">
                    <span class="negBar" values="5,10,15,20,18,16,14,20,15,16"></span>
                    <span class="negative">+0.6%</span>
                </span>
            </div>
			
			<!-- Stats item -->
            <div class="sItem usersStats">
                <h2><a title="" class="value">548463$<span>Advertiser's payments</span></a></h2>
                <div class="statsDetailed" id="s3">
                    <div class="statsContent">
                        <div class="sElements">
                            <div class="sDisplay"><h4>548463$</h4><span>last month</span></div>
                            <div class="sDisplay"><h4>36422$</h4><span>reserved for campaigns</span></div>
                            <div class="sDisplay"><h4>5373$</h4><span>payed today</span></div>
                        </div>
                        <span class="line"></span>
                        <div class="statsUpdate">
                            <span>Next update in:</span>
                            <span>10 hrs 55 min</span>
                            <div class="contentProgress"><div class="barG tipS" id="bar3" title="32%"></div></div>
                        </div>
                        <div class="statsDropBtn"><a href="#" class="button basic"><img src="/images/icons/dark/users.png" class="icon" alt="" /><span>View advertisers</span></a></div>
                    </div>
                </div>
                <span class="changes">
                    <span class="zeroBar" values="5,10,15,20,25,30,35,40,45,50"></span>
                    <span class="zero">0.0%</span>
                </span>
            </div>
			
        </div>
    </div>
	<div class="line"></div>

    <!-- Main content wrapper -->
    <div class="wrapper">
    
        <!-- Dynamic table -->
        <div class="widget">
            <div class="title"><img src="/images/icons/dark/full2.png" alt="" class="titleIcon" /><h6>Dynamic table</h6></div>
            <table cellpadding="0" cellspacing="0" border="0" class="display dTable">
            <thead>
            <tr>
            <th>Логин</th>
            <th>Эл. почта</th>
            <th>Страна</th>
            <th>Сайт</th>
            <th>Количество кампаний</th>
            <th>Баланс счета</th>
            <th>Статус</th>
            <th>Действия</th>
            </tr>
            </thead>
            <tbody>
            <?php foreach ($this->all as $val) { ?>
                <?php if ($val['id_status'] == 2) { ?>
                    <tr class="gradeC">
                <?php } elseif ($val['id_status'] == 3) { ?>    
                        <tr class="gradeX">
                <?php } else { ?>
                        <tr class="gradeA">    
                <?php } ?>            
                <td><?php echo '<a href="'.$this->url(array(
                        'module'     => 'back',
                        'controller' => 'admin',
                        'action'     => 'advertiser',
                        'id'         => $val['id']
                    )).'">'.$val['login'].'</a>'; ?>
                </td>
                <td><?php echo $val['email']; ?></td>
                <td>Country</td>
                <td><?php echo $val['website']; ?></td>
                            <td class="center"><?php echo $val['count_adver']; ?></td>
                            <td class="center">Balance</td>
                            <td class="center"><?php echo $val['name']; ?></td>
                            <td class="center">email 
                           <!-- если юзер активен - кнопка 'block' -->
                           <?php if ($val['id_status'] == 1 ) {
                                   echo '<a href="'.$this->url(array(
                                        'module'     => 'back',
                                        'controller' => 'admin',
                                        'action'     => 'blockadver',
                                        'id'         => $val['id']
                                    )).'">block</a>'; 
                                   //если регистрация не подвтерждена - кнопка 'confirm'
                                 } elseif($val['id_status'] == 2) {
                                         echo '<a href="'.$this->url(array(
                                            'module'     => 'back',
                                            'controller' => 'admin',
                                            'action'     => 'confirmadver',
                                            'id'         => $val['id']
                                         )).'">confirm</a>';
                                   //если заблокирован - кнопка 'unblock'
                                 } else {
                                        echo '<a href="'.$this->url(array(
                                            'module'     => 'back',
                                            'controller' => 'admin',
                                            'action'     => 'unblockadver',
                                            'id'         => $val['id']
                                         )).'">unblock</a>';
                                 }
                               ?> 
                                <?php echo '<a href="'.$this->url(array(
                                    'module'     => 'back',
                                    'controller' => 'admin',
                                    'action'     => 'deleteadver',
                                    'id'         => $val['id']
                                )).'">delete</a>'; ?>
                            </td>                            
                </tr>                 
            <?php } ?>
            </tbody>
            </table>  
        </div>
    
    </div>